//package com.demo.redis;
//
//import java.util.HashSet;
//import java.util.Set;
//
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
//import org.springframework.boot.context.properties.EnableConfigurationProperties;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.context.annotation.Scope;
//
//import redis.clients.jedis.HostAndPort;
//import redis.clients.jedis.JedisCluster;
//
///**
// * 
// * @ClassName: JedisClusterConfig
// * @Description: 閫氳繃node鑺傜偣鏂瑰紡鑾峰彇reids杩炴帴 
// * @author wqq
// * @date 2017骞�鏈�鏃�涓婂崍11:33:18
// *
// */
//@Configuration
//@ConditionalOnClass({JedisCluster.class})
//@EnableConfigurationProperties(RedisProperties.class)
//public class JedisClusterConfig {
//
//	@Autowired
//	private RedisProperties redisProperties;
//
//	@Bean(name = "jedisCluster")
//	@Scope("singleton")
//	public JedisCluster getJedisCluster() {
//		String[] serverArray = redisProperties.getClusterNodes().split(",");
//		Set<HostAndPort> nodes = new HashSet<HostAndPort>();
//		for (String ipPort : serverArray) {
//			String[] ipPortPair = ipPort.split(":");
//			nodes.add(new HostAndPort(ipPortPair[0].trim(), Integer
//					.valueOf(ipPortPair[1].trim())));
//		}
//		return new JedisCluster(nodes, redisProperties.getCommandTimeout());
//	}
//}
